package models

import "gorm.io/gorm"

type Order struct {
	gorm.Model
	UserId  int64   `gorm:"type:int(10)" json:"userId"`
	OrderSn string  `gorm:"type:char(200)" json:"orderSn"`
	Total   float64 `gorm:"type:decimal(10,2)" json:"total"`
	Status  int64   `gorm:"type:int(10)" json:"status"`  //1 待支付 2 已支付 3 代发货
	PayType int64   `gorm:"type:int(10)" json:"payType"` //1 微信 2 支付宝
	Address string  `gorm:"type:varchar(50)" json:"address"`
}

type OrderItem struct {
	gorm.Model
	OrderSn      string  `gorm:"type:char(200)" json:"orderSn"`
	ProductId    uint    `gorm:"type:int(10)" json:"productId"`
	ProductName  string  `gorm:"type:varchar(100)" json:"productName"`
	ProductPrice float64 `gorm:"type:decimal(10,2)" json:"productPrice"`
	ProductImage string  `gorm:"type:varchar(200)" json:"productImage"`
	Quantity     int     `gorm:"type:int(10)" json:"quantity"`
	SubTotal     float64 `gorm:"type:decimal(10,2)" json:"subTotal"`
}
